package demo05;

import java.util.ArrayList;
import java.util.Random;
//成员
public class Member {
	private String name;
	private int money;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getMoney() {
		return money;
	}
	public void setMoney(int money) {
		this.money = money;
	}
	public Member(String name, int money) {
		this.name = name;
		this.money = money;
	}
	public Member() {
	}
	
	public void show(){
		System.out.println("姓名:"+name+", 余额度:"+money);
	}
	
	public void recevice(ArrayList<Integer> list){
		int index = new Random().nextInt(list.size());
		//�����������Ӽ�����ɾ�������������õ�ɾ����ĺ�����Լ�
		Integer delta = list.remove(index);
//		int money2 = this.getMoney();
		this.setMoney(delta+this.getMoney());
	}
}
